
#include <BRawSocket>
#include "member_BSocket.h"

using namespace BWE;

#define member					(*(member_BSocket*)_ptr)
#define member_allocate()		_ptr = new member_BSocket
#define member_release()		delete (member_BSocket*)_ptr

#ifdef _LINUX_

BRawSocket::BRawSocket()
{
	member_allocate();
	int protocol = 1;
	socket_member(this)->create(AF_INET, SOCK_RAW, protocol);
}
BRawSocket::~BRawSocket()
{
	socket_member(this)->destroy();
	member_release();
}

BRawSocket::Type BRawSocket::type() const
{
	return Type_RawSocket;
}

#endif

#ifdef _WINDOWS_SYSTEM_

BRawSocket::BRawSocket()
{

}
BRawSocket::~BRawSocket()
{

}

BRawSocket::Type BRawSocket::type() const
{
	return RawSocket;
}

#endif

